<?php $this->load->view('common/head');?>
<?php $this->load->view('common/navbar');?>
<form class="form-inline" method="GET" name="report" id="report">
<input type="hidden" name="c" id="c" value="Report">
<input type="hidden" name="m" id="m" value="index">
<!-- Table -->
  <table class="table table-condensed">
    <tbody>
      <tr>
        <td class="bg-primary col-md-2">所属区域：</td>
        <td>
        	<div class="form-group">
			    <label for="area">地区:</label>
			    <select class="form-control" id="area" name="area">
				  <option value="">请选择地区</option>
				</select>
			  </div>
			  <div class="form-group">
			    <label for="region">大区:</label>
			    <select class="form-control" id="region" name="region">
				  <option value="">请选择大区</option>
				</select>
			  </div>
			  <div class="form-group">
			    <label for="province">省份:</label>
			    <select class="form-control" id="province" name="province">
				  <option value="">请选择省份</option>
				</select>
			  </div>
			  <div class="form-group">
			    <label for="city">城市:</label>
			    <select class="form-control" id="city" name="city">
				  <option value="">请选择城市</option>
				</select>
			  </div>
			  <div class="form-group">
			    <label for="storeId">专营店:</label>
			    <select class="form-control" id="storeId" name="storeId">
				  <option value="">请选择专营店</option>
				</select>
			  </div>
        </td>
      </tr>
      <tr>
        <td class="bg-primary col-md-2">所属年月：</td>
        <td>
        	  <div class="form-group">
			    <label for="year">所属年份：</label>
			    <select class="form-control" required id="year" name="year">
			      <option value="">请选择</option>
				</select>
			  </div>
			  <div class="form-group">
			    <label for="timeUnit">所属双月：</label>
			    <select class="form-control" required id="timeUnit" name="timeUnit">
			      <option value="">请选择</option>
				</select>
			  </div>
        </td>
      </tr>
      <tr>
        <td class="bg-primary col-md-2">是否为补报：</td>
        <td>
        	<div class="form-group">
			    <label class="radio-inline">
				  <input type="radio" required name="isBubao" id="isBubao1" <?=$isBubao==0 ? 'checked' : ''?> value="0"> 否
				</label>
				<label class="radio-inline">
				  <input type="radio" required name="isBubao" id="isBubao2" <?=$isBubao==1 ? 'checked' : ''?> value="1"> 是
				</label>
			</div>
        </td>
      </tr>
      <tr>
        <td class="bg-primary col-md-2">报表类型：</td>
        <td>
        	<div class="form-group">
			    <select class="form-control" required id="reportType" name="reportType">
			      <option value="">请选择</option>
			      <?php foreach ($this->reportType as $k => $v) {?>
			      <option value="<?=$k?>"><?=$v?></option>
			      <?php } ?>
				</select>
			  </div>
        </td>
      </tr>
      <tr>
      	<td colspan="2" class="text-center">
      		<button type="submit" name="submit" id="submit" value="export" class="btn btn-default  btn-primary">导出</button>
      	</td>
      </tr>
    </tbody>
  </table>
</form>
<script type="text/javascript">
	$(function(){
		$('form[name="report"]').find("input,select,textarea").not("[type=submit]").jqBootstrapValidation();
		loadYearList('year',<?=$year ? $year : 0?>);
	    loadTimeUnitList('timeUnit',<?=$year ? $year : 0?>,<?=$timeUnit ? $timeUnit : 0?>);
		loadPlaceList('area', 'area', '', '<?=$area?>');
		loadPlaceList('region', 'region', '<?=$area?>', '<?=$region?>');
		loadPlaceList('province', 'province', '<?=$region?>', '<?=$province?>');
		loadPlaceList('city', 'city', '<?=$province?>', '<?=$city?>');
		loadPlaceList('storeId', 'store', '<?=$city?>', '<?=$storeId?>');
	});
    $("#year").change(function(){
      loadTimeUnitList('timeUnit',this.value);
    });
	$('#area').change(function(){
		loadPlaceList('region', 'region', this.value, '');
		loadPlaceList('province', 'province', '', '');
		loadPlaceList('city', 'city', '', '');
		loadPlaceList('storeId', 'store', '', '');
	});
	$('#region').change(function(){
		loadPlaceList('province', 'province', this.value, '');
		loadPlaceList('city', 'city', '', '');
		loadPlaceList('storeId', 'store', '', '');
	});
	$('#province').change(function(){
		loadPlaceList('city', 'city', this.value, '');
		loadPlaceList('storeId', 'store', '', '');
	});
	$('#city').change(function(){
		loadPlaceList('storeId', 'store', this.value, '');
	});
</script>
<?php $this->load->view('common/foot');?>